home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CDOS10.ARJ / USERDOC.TXT < prev   
Text File  |  1992-07-07  |  62KB  |  2,073 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  9.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  10.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  11.           ▒▒▒▒▒▒▒▒▒▒▒▒▒████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  12.           ▒▒▒▒▒▒▒▒▒▒▒▒█████    ████ ▒▒▒▒█████▒▒▒██████▒▒██████▒▒▒▒▒▒▒▒▒▒▒▒▒
  13.           ▒▒▒▒▒▒▒▒▒▒▒▒████  ▒▒▒▒    ▒▒▒▒██  ██▒▒██  ██ ▒██     ▒▒▒▒▒▒▒▒▒▒▒▒
  14.           ▒▒▒▒▒▒▒▒▒▒▒▒████ ▒▒▒▒▒▒▒▒▒▒▒▒▒██ ▒██ ▒██ ▒██ ▒▒  ▒██▒▒▒▒▒▒▒▒▒▒▒▒▒
  15.           ▒▒▒▒▒▒▒▒▒▒▒▒█████▒▒▒▒████▒▒▒▒▒█████  ▒██████ ▒██████ ▒▒▒▒▒▒▒▒▒▒▒▒
  16.           ▒▒▒▒▒▒▒▒▒▒▒▒▒████████████ ▒▒▒▒▒     ▒▒▒      ▒▒      ▒▒▒▒▒▒▒▒▒▒▒▒
  17.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ████████   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  18.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒        ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  19.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  20.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  21.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  22.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  23.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█ The LIBerator 1.0 █ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  24.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  25.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒                     ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  26.           ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  27.  
  28.                         The reliable C library of functions,
  29.                              for the DOS environnement.
  30.  
  31.              This manual may be freely distributed in its original form.
  32.                       Modifications of any kind are prohibited.
  33.  
  34.            This manual and software are made available without warranties.
  35.            TNG SOFT nor the author shall be held liable to the user or any
  36.            other person or entity with respect to any liability, loss, or
  37.            damage caused or alleged to be caused directly or indirectly by
  38.                               this manual or software.
  39.  
  40.                  This software is shareware, and must be registered.
  41.  
  42.                      This library is the property of the author.
  43.                        You are granted the rights to use only.
  44.  
  45.                   LIBerator is a registered trademark of TNG SOFT.
  46.  
  47.                 The original manual and software may be obtained from
  48.  
  49.                                 STARFLEET COMMAND BBS
  50.                               (418)  525-6899/4740/6803
  51.                                  FidoNet: 1:240/1701
  52.                             F'req magic name >  LIBERATR
  53.  
  54.  
  55.           ▀█▀ █▀█ █▀▀  █▀▀ █▀█ █▀▀ ▀█▀
  56.            █  █ █ █▄█  ▄▄█ █▄█ █▀   █          The Next Generation Software
  57.  
  58.  
  59.  
  60.  
  61.           The LIBerator 1.0        User's Guide                      Page 2
  62.  
  63.  
  64.  
  65.  
  66.           Chapter  1:    Overview .....................................   6
  67.                               Why use LIBerator ? .....................   6
  68.                               What is LIBerator ? .....................   6
  69.                               Current version .........................   7
  70.                               A word about registration ...............   7
  71.                               What's next ? ...........................   7
  72.  
  73.           Chapter  2:    Getting started ..............................   8
  74.                               Library specifics .......................   8
  75.                               Installation ............................   8
  76.                               How to use this library .................   9
  77.                               How to use this document ................  10
  78.  
  79.           Chapter  3:    Using LIBerator's templates ..................  11
  80.  
  81.           Chapter  4:    Using LIBerator's functions ..................  13
  82.  
  83.           Chapter  5:    LIBerator's standard functions <STDFCTS.H> ...  14
  84.                               assert ..................................  14
  85.                               arg_exist ...............................  16
  86.                               arg_iexist ..............................  16
  87.                               heapalloc ...............................  17
  88.                               heapfree ................................  17
  89.  
  90.           Chapter  6:    LIBerator's keyboard functions <KEYBFCTS.H> ..  18
  91.                               getkey ..................................  18
  92.  
  93.           Chapter  7:    LIBerator's file functions <FILEFCTS.H> ......  20
  94.                               fnewline ................................  20
  95.                               fsize ...................................  20
  96.                               fcopy ...................................  21
  97.  
  98.           Chapter  8:    LIBerator's screen functions <SCRFCTS.H> .....  22
  99.                               scr_vsave ...............................  22
  100.                               scr_vrestore ............................  23
  101.                               scr_csave ...............................  24
  102.                               scr_crestore ............................  24
  103.  
  104.           Chapter  9:    LIBerator's string functions <STRFCTS.H> .....  25
  105.                               str_len .................................  25
  106.                               str_cpy .................................  25
  107.                               str_cmp .................................  26
  108.                               str_icmp ................................  26
  109.                               str_toupper .............................  27
  110.                               str_tolower .............................  27
  111.                               str_pastoc ..............................  28
  112.                               str_ctopas ..............................  28
  113.                               str_trim ................................  29
  114.                               str_invnames ............................  29
  115.  
  116.  
  117.  
  118.  
  119.           The LIBerator 1.0        User's Guide                      Page 3
  120.  
  121.  
  122.  
  123.  
  124.  
  125.           Chapter 10:    LIBerator's time functions <TIMEFCTS.H> ......  30
  126.                               ticktimer_install .......................  30
  127.                               ticktimer_reset .........................  31
  128.                               ticktimer_read ..........................  31
  129.                               diffdate ................................  32
  130.  
  131.           Chapter 11:    LIBerator's misc functions <MISCFCTS.H> ......  33
  132.                               ansicolor ...............................  33
  133.  
  134.           Appendix A:    Extended keycodes ............................  34
  135.  
  136.           Appendix B:    Color codes and Symbolic constants ...........  35
  137.  
  138.           Appendix C:    Support ......................................  36
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.           The LIBerator 1.0        User's Guide                      Page 4
  178.  
  179.  
  180.  
  181.  
  182.           This page intentionally left blank
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.           The LIBerator 1.0        User's Guide                      Page 5
  236.  
  237.  
  238.  
  239.  
  240.           This page intentionally left blank
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.           The LIBerator 1.0        User's Guide                      Page 6
  294.  
  295.  
  296.  
  297.  
  298.           █████████████████████████████████████████████████████████████████
  299.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  300.           C  H  A  P  T  E  R     1                                Overview
  301.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  302.  
  303.           Welcome  to  LIBerator  !   This  C  library is  a  collection of
  304.           routines  for the DOS  environnement that were  developped by TNG
  305.           SOFT.   Those functions are general  enough to be useful in other
  306.           applications.
  307.  
  308.  
  309.           Why use LIBerator ?
  310.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  311.  
  312.           Why  reinvent the wheel when someone  before you created one that
  313.           works quite well ?
  314.  
  315.           Professional  programmers  like  to write  all  of  there general
  316.           purpose functions themselves.  They want to know what's inside.
  317.  
  318.           But,  if you're not into  serious programming, and sometimes have
  319.           to write short programs, LIBerator is for you.  This library will
  320.           give  you  access  to  useful  routines  that  will  shorten your
  321.           developpement  time and  make your code  more reliable.   It will
  322.           effectively  free you  from having to  write many  of the general
  323.           functions your program might need.
  324.  
  325.  
  326.           What is LIBerator ?
  327.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  328.  
  329.           Because I am big on modularity, I try to put general purpose code
  330.           together in a separate function.  Therefore, after developping an
  331.           application,  I am often left with  many useful functions.  Those
  332.           can  be recycled  easily and  reduce developpement  time of other
  333.           applications.
  334.  
  335.           I've decided to make this code available to everyone through this
  336.           library.  All those functions were tested thouroughly, and put to
  337.           work  in  actual  applications.   You  can be  sure  they'll work
  338.           correctly, if you use them correctly !
  339.  
  340.           All functions are FULLY documented in the following pages.
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.           The LIBerator 1.0        User's Guide                      Page 7
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.           Current Version
  359.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  360.  
  361.           The complete history of LIBerator can be found in the HISTORY.TXT
  362.           file, included in the archive.
  363.  
  364.  
  365.           A word about registration
  366.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  367.  
  368.           LIBerator  is made available  under the shareware  concept.  This
  369.           means  that after  an evaluation  period of  30 days,  you should
  370.           register  this software with its author.  Furthermore, if you use
  371.           this  software to  create your  own shareware  software, YOU MUST
  372.           REGISTER LIBerator.
  373.  
  374.           Registration grants you a life-time license to use this software,
  375.           and all following versions or updates.
  376.  
  377.           LIBerator  is NOT  crippled in  any way.   There  is absolutly no
  378.           differences between the registered or unregistered version.
  379.  
  380.           To  register this software, fill in the REGISTER.TXT registration
  381.           form included in the archive.  Registration is $10 CANADIAN.  You
  382.           will  receive  via  'snail  mail'  an  official  registered  user
  383.           certificate with your registration number.
  384.  
  385.           LIBerator and TNG SOFT ENTERPRISES are registered trade marks.
  386.  
  387.  
  388.           What's Next ?
  389.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  390.  
  391.           Everytime  I write a general purpose function, and think it could
  392.           benefit  others,  I will  include  it in  the  LIBerator package.
  393.           Every  now and then, a  new version of this  library will be made
  394.           public, including those new functions.
  395.  
  396.           I  will try to improve  the functions already there.   I will not
  397.           accept  special demands.  The purpose  of this library is to make
  398.           available code that I have in my personal library.
  399.  
  400.           So, that's about it for now !  Have fun and enjoy !
  401.  
  402.  
  403.           Rémy Gendron
  404.           author of LIBerator
  405.  
  406.  
  407.  
  408.  
  409.           The LIBerator 1.0        User's Guide                      Page 8
  410.  
  411.  
  412.  
  413.  
  414.           █████████████████████████████████████████████████████████████████
  415.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  416.           C  H  A  P  T  E  R     2                         Getting started
  417.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  418.  
  419.           Installing and using the LIBerator library is very simple.
  420.  
  421.  
  422.           Library specifics
  423.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  424.  
  425.           LIBerator's  functions are for the  DOS environnement.  They try,
  426.           but do not always follow the ANSI standard.
  427.  
  428.           LIBerator was developped under BORLAND C++ 3.0.
  429.  
  430.           The  code  was  compiled  under the  'huge'  memory  model.   All
  431.           prototypes were declared as 'far' functions and all pointers were
  432.           explicitely   declared   'huge'.      This   will   provide  full
  433.           compatibility  when  linking to  most  memory model  sizes.   You
  434.           should  consult  your  compiler  documentation  about interfacing
  435.           different memory models.
  436.  
  437.           Unless  you REALLY know what you are doing, you should always use
  438.           'huge'  pointers.    'far'  pointers can  cause  wrap  around and
  439.           comparison  problems  because  they  are  not  normalised.    All
  440.           LIBerator's functions use 'huge' pointers.
  441.  
  442.           The  video output  is done  through direct  screen writes.   This
  443.           makes for incredibly fast output.  Going through the BIOS is just
  444.           to  slow.  However,  under multitaskers like  Deskview, who often
  445.           work  in textmode, screen bleeds can  occur if the application is
  446.           running  in the  background.   Use the  virtualising options when
  447.           running under DeskView.
  448.  
  449.           All   header  files   use  conditional   compilation  to  prevent
  450.           redeclaration  errors at compile time.  So, if you're not sure if
  451.           a  header  was previously  included  (possibly by  another header
  452.           file), feel free to include it again.
  453.  
  454.  
  455.           Installation
  456.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  457.  
  458.           Unpack the archive in a temporary directory.  If you haven't done
  459.           so,  you should really  print all of the  USER'S GUIDE for easier
  460.           reading.  It as been formatted to print at 60 lines per pages.
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.           The LIBerator 1.0        User's Guide                      Page 9
  468.  
  469.  
  470.  
  471.  
  472.  
  473.           Put  all header files (.H) into an INCLUDE directory.  Just to be
  474.           sure you won't overwrite existing header files, you should make a
  475.           separate include directory, then include it in the 'include' path
  476.           of your compilator.
  477.  
  478.           Then  put the LIBerator  library (LIBERATR.LIB) into  one of your
  479.           LIBRARY directories.
  480.  
  481.  
  482.           How to use this library
  483.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  484.  
  485.           To  use a library function, just  include its header file in your
  486.           source  code.  YOU  MUST NOT write a  prototype yourself based on
  487.           the  prototypes written in this manual.   The real prototypes may
  488.           have additional informations in them.  So, for example:
  489.  
  490.           #include <stdio.h>                   /* A standard header file */
  491.           #include "stdfcts.h"                /* A LIBerator header file */
  492.  
  493.           void main (void)
  494.           {
  495.                ...
  496.                                 /* Here you can use the desired function */
  497.                ...
  498.                return ;
  499.           }
  500.  
  501.           You  then have to  link all your  modules together, including the
  502.           LIBERATR.LIB  library.  You do  that by including LIBERATR.LIB in
  503.           your  project.    LIBERATR.LIB must  be  in one  of  your LIBRARY
  504.           directories.  That's all there is to it !
  505.  
  506.           If  you get linker  errors, that's probably  because you compiled
  507.           your  sources  in C++.    You must  compile  in C,  or  else make
  508.           interfaces with the 'extern "C"' keyword.
  509.  
  510.           All  arguments  to functions  are FULLY  validated.   A LIBerator
  511.           function will never let you get away if it is called incorrectly.
  512.           If something is wrong, the program is stopped and a plain english
  513.           error  message tells you what went wrong, where and why !  In the
  514.           function descriptions, when it says that you SHOULD NOT or CANNOT
  515.           do  something, it means that if you do it, you'll get a LIBerator
  516.           error message.  Your program will not crash !
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.           The LIBerator 1.0        User's Guide                     Page 10
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.           How to use this document
  533.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  534.  
  535.           The following conventions are used in the document:
  536.  
  537.                     All of LIBerator's functions were declared of type far,
  538.                     but  the far modifier was left out of the prototypes in
  539.                     this manual.
  540.  
  541.           The following symbols are used in the text:
  542.  
  543.                     ''   Regular C and C++ keywords
  544.  
  545.                     {}   LIBerator's keywords
  546.  
  547.                     <>   Arguments to functions
  548.  
  549.                     -->  Important remarks (that you MUST read)
  550.  
  551.                     CAPS Keyboard keys
  552.  
  553.           Related  functions are  grouped together in  the same  module.  A
  554.           chapter is devoted to each module.
  555.  
  556.           At the end, reference informations can be found in appendixes.
  557.  
  558.           I  will gladly answer any questions.   See the appendix 'Support'
  559.           to know how to reach me !
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.           The LIBerator 1.0        User's Guide                     Page 11
  584.  
  585.  
  586.  
  587.  
  588.           █████████████████████████████████████████████████████████████████
  589.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  590.           C  H  A  P  T  E  R     3             Using LIBerator's templates
  591.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  592.  
  593.           LIBerator  provides  you with  some  starting templates  for your
  594.           programs.   Templates are important  to facilitate consistency in
  595.           your programming style.
  596.  
  597.           If  you already  have your  own style  and templates,  stick with
  598.           them.   The included templates are  for new programmers, or those
  599.           of you who are still searching.
  600.  
  601.           Of  course, those are just suggestions.   For instance, the usage
  602.           and  placement  of  parenthesis,  currently  generates  many  hot
  603.           debates.   Some will  follow the 'professional'  style and open a
  604.           block this way :
  605.  
  606.           while (condition) {
  607.              statements ;
  608.              statements ;
  609.           }
  610.  
  611.           While others (and I), do it this way :
  612.  
  613.           while (condition)
  614.           {
  615.              statement ;
  616.              statement ;
  617.           }
  618.  
  619.           Choose  your  own  style !    The following  files  are therefore
  620.           included for your convenience :
  621.  
  622.           MAIN.C         Template  for your main source  file.  This is the
  623.                          only file with a 'main' function declaration.
  624.  
  625.           FUNCTION.C     Template for your secondary modules' code files.
  626.  
  627.           FUNCTION.H     Template for your secondary modules' header files.
  628.  
  629.           STDMACRO.H     Template for your standard macro definitions.  Put
  630.                          in this file your standard macros that can be used
  631.                          with many different projects.
  632.  
  633.                     -->  This  file contains declarations  for the TRUE and
  634.                          FALSE macros.
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.           The LIBerator 1.0        User's Guide                     Page 12
  642.  
  643.  
  644.  
  645.  
  646.  
  647.           PRJMACRO.H     Template  for  macros particular  to  your current
  648.                          project.   Put in  this file, macros  that will be
  649.                          needed  by many modules.   You should place macros
  650.                          specific  to a module in the module's local macros
  651.                          section.
  652.  
  653.           STDTYPE.H      Template  for your standard type definitions.  Put
  654.                          in  this file  your standard typedefs  that can be
  655.                          used with many different projects.
  656.  
  657.                     -->  This  file contains  declarations for  the {bool},
  658.                          {byte}, {word} and {dword} types.
  659.  
  660.           PRJTYPE.H      Template  for typedefs particular  to your current
  661.                          project.   Put in this file, typedefs that will be
  662.                          needed by many modules.  You should place typedefs
  663.                          specific   to  a  module  in  the  module's  local
  664.                          typedefs section.
  665.  
  666.           HEADTEST.C     Template  to test  your header  files. Often, they
  667.                          will  compile correctly  because some  other files
  668.                          were  included  before  your header.    This could
  669.                          cause  problems if  you intend to  use this header
  670.                          file  elsewhere, or  make them  available to other
  671.                          programmers.    Your  header  files  should always
  672.                          compile  alone by themselves.  Test them with this
  673.                          file.
  674.  
  675.           Templates  promote consistency  and free you  from tedious tasks.
  676.           Also,  having  something to  start with,  you  won't as  often be
  677.           afflicted by the 'blank page' syndrome !
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.           The LIBerator 1.0        User's Guide                     Page 13
  700.  
  701.  
  702.  
  703.  
  704.           █████████████████████████████████████████████████████████████████
  705.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  706.           C  H  A  P  T  E  R     4             Using LIBerator's Functions
  707.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  708.  
  709.           There  are  two  types  of functions  in  the  LIBerator library.
  710.           Functions available in the standard libraries, and new functions.
  711.  
  712.           Because  I  like  to  compile in  the  'huge'  memory  model, all
  713.           functions  have been written to be of type 'far'.  They will also
  714.           accept  'huge' pointers without  the need for  a typecast.  Those
  715.           functions  don't call the standard run-time libraries.  They were
  716.           entirely  rewritten.   There is  no overhead  and they  are fully
  717.           optimized.
  718.  
  719.           New functions have been written because they weren't available in
  720.           the standard libraries.
  721.  
  722.           Some conventions have been adopted for the function names:
  723.  
  724.           Related  functions  will  have  the same  function  prefix.   For
  725.           instance, all string functions will begin by {str_}.
  726.  
  727.  
  728.           -->  Function  declarations  can use  types like  {bool}, {byte},
  729.                {word}   and  {dword}.    See   the  file  STDTYPE.H  for  a
  730.                description of those types.
  731.  
  732.           A function description uses the following format:
  733.  
  734.  
  735.           FUNCTION NAME
  736.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  737.  
  738.           ■ Summary Short description of this function behavior.
  739.  
  740.           ■ Syntax  #include "header.h"
  741.                     ReturnType FonctionName (<param>, <param>, ...) ;
  742.  
  743.                     YOU  MUST  NEVER  WRITE  A  PROTOTYPE  FOR  A  FUNCTION
  744.                     YOURSELF.   ALWAYS USE  THE PROPER HEADER  FILES.  THEY
  745.                     HAVE ADDITIONAL INFORMATIONS IN THEM !
  746.  
  747.           ■ Remarks Parameters and usage are described here when needed.
  748.  
  749.           ■ Return  The returned value of the function is explained here.
  750.  
  751.           ■ Example Examples of various calls to this function.
  752.  
  753.  
  754.  
  755.  
  756.  
  757.           The LIBerator 1.0        User's Guide                     Page 14
  758.  
  759.  
  760.  
  761.  
  762.           █████████████████████████████████████████████████████████████████
  763.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  764.           C  H  A  P  T  E  R     5          LIBerator's standard functions
  765.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  766.  
  767.           The declarations for LIBerator's standard functions are contained
  768.           in the <STDFCTS.H> header file.
  769.  
  770.           Those are the truly general and often used functions that will be
  771.           required by most of your modules.
  772.  
  773.  
  774.           ASSERT
  775.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  776.  
  777.           ■ Summary This  function  will  ASSERTain that  a  <condition> is
  778.                     TRUE.   If  it is, it  will return  immediately with no
  779.                     effect, and minimum overhead.
  780.  
  781.                     If   the  condition  is  FALSE,  the  program  will  be
  782.                     terminated  in an orderly fashion.  {assert} will clear
  783.                     the  screen, print an error  message, and terminate the
  784.                     program  with a call  to 'exit'.   This closes all open
  785.                     files,  releases any  memory allocated on  the heap and
  786.                     exit to DOS.
  787.  
  788.           ■ Syntax  #include "stdfcts.h"
  789.                     void  assert (bool  condition, char  huge *fctname, int
  790.                     errorcode,  char  huge *errortext,  int  exitcode, void
  791.                     (far *exitfct)(void)) ;
  792.  
  793.           ■ Remarks If  <condition> evaluates to FALSE, the program will be
  794.                     terminated and <fctname> will be displayed.  You should
  795.                     set  <fctname>  to  the  currently  executing function.
  796.                     This will help find the location of the error.
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.           The LIBerator 1.0        User's Guide                     Page 15
  816.  
  817.  
  818.  
  819.  
  820.  
  821.                     You can specify an error code.  If 0, the error message
  822.                     <errortext>  will  be  displayed.    You  can  also use
  823.                     predefined error codes.  In this case, <errortext> will
  824.                     have no effects.  Just set it to NULL.
  825.  
  826.                     1:   "Not  enough  memory  to create  an  array  on the
  827.                          heap."
  828.                     2:   "Not  enough  memory  to create  a  struct  on the
  829.                          heap."
  830.                     3:   "Not  enough  memory  to  allocate  the  requested
  831.                          amount of bytes."
  832.                     4:   "Out of memory."
  833.                     5:   "File not found."
  834.                     6:   "Path not found."
  835.                     7:   "File access denied."
  836.                     8:   "Input/Output error."
  837.                     9:   "Unrecoverable fatal error."
  838.  
  839.                     Then, if <exitfct> is not NULL, {assert} will call this
  840.                     function.   Set  <exitfct> to  point to  your 'cleanup'
  841.                     function.   For example, if you were working with files
  842.                     and  had made  .BAK files, this  function could restore
  843.                     the original files before termination of the program.
  844.  
  845.                -->  <exitfct> is called before all files are closed !  This
  846.                     function  MUST be of return type 'void' and have 'void'
  847.                     as argument list.
  848.  
  849.                     {assert}  will then return to DOS with an errorlevel of
  850.                     <exitcode>.
  851.  
  852.           ■ Return  None
  853.  
  854.           ■ Example assert (nbrecord>0,"datasearch",0,"No data",1,badexit);
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
  872.  
  873.           The LIBerator 1.0        User's Guide                     Page 16
  874.  
  875.  
  876.  
  877.  
  878.           ARG_EXIST
  879.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  880.  
  881.           ■ Summary This  function will check if  an argument was passed on
  882.                     the command line.  Check is case sensitive.
  883.  
  884.           ■ Syntax  #include "stdfcts.h"
  885.                     int arg_exist (char huge *string) ;
  886.  
  887.           ■ Remarks The search for the argument is case sensitive.
  888.  
  889.           ■ Return  If the command line argument <string> exists, its index
  890.                     in  the command  line argument array  will be returned.
  891.                     If  the  argument  does not  exist,  the  function will
  892.                     return 0.  See the '_argv' keyword of your compiler for
  893.                     details on accessing command line arguments.
  894.  
  895.           ■ Example if (arg_exist ("q")) sound = FALSE ;
  896.  
  897.  
  898.           ARG_IEXIST
  899.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  900.  
  901.           ■ Summary This  function will check if  an argument was passed on
  902.                     the command line.  Check is case insensitive.
  903.  
  904.           ■ Syntax  #include "stdfcts.h"
  905.                     int arg_iexist (char huge *string) ;
  906.  
  907.           ■ Remarks The search for the argument is case insensitive.
  908.  
  909.           ■ Return  If the command line argument <string> exists, its index
  910.                     in  the command  line argument array  will be returned.
  911.                     If  the  argument  does not  exist,  the  function will
  912.                     return 0.  See the '_argv' keyword of your compiler for
  913.                     details on accessing command line arguments.
  914.  
  915.           ■ Example if (arg_iexist ("bios")) directvideo = FALSE ;
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.           The LIBerator 1.0        User's Guide                     Page 17
  932.  
  933.  
  934.  
  935.  
  936.           HEAPALLOC
  937.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  938.  
  939.           ■ Summary heapalloc replaces 'farmalloc'.
  940.  
  941.           ■ Syntax  #include "stdfcts.h"
  942.                     void huge *heapalloc (dword nbytes) ;
  943.  
  944.           ■ Remarks Allocates  <nbytes> bytes on the  far heap.  {dword} is
  945.                     an unsigned long int and is declared in STDTYPE.H.
  946.  
  947.           ■ Return  This  function returns a  'huge' pointer.   Be sure the
  948.                     pointer  variable, who will receive  the pointer to the
  949.                     allocated memory,  is of type 'huge' also.
  950.  
  951.           ■ Example char huge *ptr ;
  952.                     ptr = getheap (1024) ;
  953.  
  954.  
  955.           HEAPFREE
  956.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  957.  
  958.           ■ Summary Freeheap replaces 'farfree'.
  959.  
  960.           ■ Syntax  #include "stdfcts.h"
  961.                     void heapfree (void huge *block) ;
  962.  
  963.           ■ Remarks The   only  difference  from  'farfree'  is  that  this
  964.                     function  offers the convenience  of accepting a 'huge'
  965.                     pointer as argument.
  966.  
  967.           ■ Return  None
  968.  
  969.           ■ Example char huge *ptr ;
  970.                     ptr = heapalloc (sizeof (object)) ;  // Allocate memory
  971.                     heapfree (ptr) ;                         // Free memory
  972.                     ptr = NULL ;                      // Always a good idea
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.           The LIBerator 1.0        User's Guide                     Page 18
  990.  
  991.  
  992.  
  993.  
  994.           █████████████████████████████████████████████████████████████████
  995.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  996.           C  H  A  P  T  E  R     6          LIBerator's keyboard functions
  997.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  998.  
  999.           The declarations for LIBerator's keyboard functions are contained
  1000.           in the <KEYBFCTS.H> header file.
  1001.  
  1002.  
  1003.           GETKEY
  1004.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1005.  
  1006.           ■ Summary This   is  a  replacement   for  the  familiar  'getch'
  1007.                     function.
  1008.  
  1009.           ■ Syntax  #include "keybfcts.h"
  1010.                     int getkey (int filter) ;
  1011.  
  1012.           ■ Remarks One  of 'getch' weakness is  its inability to deal with
  1013.                     the way extended keys are internaly represented.  Those
  1014.                     are  the keys that don't  have an ASCII code associated
  1015.                     with  them.    For  exemple,  the  function,  arrow and
  1016.                     editing keys all return an extended keycode.
  1017.  
  1018.                     This   new  {getkey}  function  will  deal  with  these
  1019.                     extended  keys by adding 256  to the extended key code.
  1020.                     Appendix A lists all of the extended keycodes currently
  1021.                     available on an extended keyboard.
  1022.  
  1023.                     You  MUST specify a <filter> to be used by the {getkey}
  1024.                     function.   A filter of 0 will allow any key to be read
  1025.                     and returned by the function.  You can also provide the
  1026.                     ASCII  or extended key code (remember to add 256 to the
  1027.                     real  code) of the  only key allowed  to be returned by
  1028.                     the  function.  This provides an easy way to WAIT FOR a
  1029.                     specific  key.  The function will then return with that
  1030.                     keycode, only when that key has been pressed.
  1031.  
  1032.                -->  When  you  call  {getkey},  it  will  first  flush  the
  1033.                     keyboard buffer of any keys already present.
  1034.  
  1035.                -->  Beware of NEVER setting the filter to an impossible key
  1036.                     entry,  or you will be trapped by the {getkey} function
  1037.                     !
  1038.  
  1039.           ■ Return  If  a normal key was pressed,  the returned value is an
  1040.                     int representing the ASCII code of that key.  (1-255)
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.           The LIBerator 1.0        User's Guide                     Page 19
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.                     If  an extended key was  pressed, the returned value is
  1054.                     an  int representing  the extended  key code  plus 256.
  1055.                     (256-396)
  1056.  
  1057.           ■ Example getkey (0) ;        /* Returns the first key pressed */
  1058.                     getkey (13) ;              /* Wait for the ENTER key */
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.           The LIBerator 1.0        User's Guide                     Page 20
  1106.  
  1107.  
  1108.  
  1109.  
  1110.           █████████████████████████████████████████████████████████████████
  1111.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1112.           C  H  A  P  T  E  R     7              LIBerator's file functions
  1113.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1114.  
  1115.           The  declarations for LIBerator's file functions are contained in
  1116.           the <FILEFCTS.H> header file.
  1117.  
  1118.  
  1119.           FNEWLINE
  1120.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1121.  
  1122.           ■ Summary Go to start of next line on a text file.
  1123.  
  1124.           ■ Syntax  #include "filefcts.h"
  1125.                     int fnewline (FILE *f) ;
  1126.  
  1127.           ■ Remarks The end of a text line is marked by the character '\n'.
  1128.  
  1129.           ■ Return  If the start of a new line was found, '\n' is returned.
  1130.                     If  end of  file was  reach before  a new  line, EOF is
  1131.                     returned.
  1132.  
  1133.           ■ Example error = fnewline (text) ;
  1134.  
  1135.  
  1136.           FSIZE
  1137.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1138.  
  1139.           ■ Summary Return the size of a file.
  1140.  
  1141.           ■ Syntax  #include "filefcts.h"
  1142.                     dword fsize (FILE *f) ;
  1143.  
  1144.           ■ Remarks On  a text  file, the new  line character is  in fact 2
  1145.                     bytes  long.  DOS stores '\n'  as a combination of '\n'
  1146.                     and '\r'.  So, the length of a text file will not match
  1147.                     the number of characters read with 'fgetc'.
  1148.  
  1149.           ■ Return  {fsize}  returns the  size of  the file  in bytes  as a
  1150.                     {dword}.    {dword}  is  defined  in  STDTYPE.H  as  an
  1151.                     unsigned long int.
  1152.  
  1153.           ■ Example size = fsize (text) ;
  1154.  
  1155.  
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.           The LIBerator 1.0        User's Guide                     Page 21
  1164.  
  1165.  
  1166.  
  1167.  
  1168.           FCOPY
  1169.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1170.  
  1171.           ■ Summary Copy a file.
  1172.  
  1173.           ■ Syntax  #include "filefcts.h"
  1174.                     int  fcopy  (char huge  *srcpath, char  huge *destpath,
  1175.                     bool verify) ;
  1176.  
  1177.           ■ Remarks <srcpath> is copied to <destpath>.  Paths are expressed
  1178.                     in the form [d:][path]filename.ext.
  1179.  
  1180.                -->  No wildcards are allowed.
  1181.  
  1182.                     If  <verify> is set  to TRUE, the 2  files will then be
  1183.                     reread  and compared.   This is different  from the DOS
  1184.                     verify,  who don't reread the files, and is therefore a
  1185.                     little slower.
  1186.  
  1187.           ■ Return  If  the  copy  was succesful  and  error  free, {fcopy}
  1188.                     returns 0.  On error, 1 is returned.
  1189.  
  1190.           ■ Example error = fcopy ("autoexec.bat","autoexec.bak",1) ;
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.           The LIBerator 1.0        User's Guide                     Page 22
  1222.  
  1223.  
  1224.  
  1225.  
  1226.           █████████████████████████████████████████████████████████████████
  1227.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1228.           C  H  A  P  T  E  R     8            LIBerator's screen functions
  1229.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1230.  
  1231.           The  declarations for LIBerator's  screen functions are contained
  1232.           in the <SCRFCTS.H> header file.
  1233.  
  1234.  
  1235.           SCR_VSAVE
  1236.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1237.  
  1238.           ■ Summary This  function will  save the current  screen and video
  1239.                     attributes  in a 'text_info' structure.  It has exactly
  1240.                     the  same  effects as  a  call to  'gettextinfo'.   The
  1241.                     difference  is that it can  also save the actual screen
  1242.                     content.
  1243.  
  1244.           ■ Syntax  #include "scrfcts.h"
  1245.                     void   scr_vsave  (struct  text_info   huge  *ti,  char
  1246.                     huge*huge *savedscr) ;
  1247.  
  1248.           ■ Remarks All  members  of  the  'text_info'  structure  <ti> are
  1249.                     filled  with  this  function.    <savedscr>  is  a huge
  1250.                     pointer  to a huge  char pointer.   If this argument is
  1251.                     provided,  the screen content  will also be  saved to a
  1252.                     buffer  in the heap, and the  huge pointer to char will
  1253.                     be  set to point to this buffer.   If you don't want to
  1254.                     save the screen area, set <savedscr> to NULL.
  1255.  
  1256.                -->  Cursor  attributes are saved, but  will not be restored
  1257.                     by  {scr_vrestore}.   You must use  the {scr_csave} and
  1258.                     {scr_crestore}.
  1259.  
  1260.           ■ Return  None
  1261.  
  1262.           ■ Example struct text_info ti ;
  1263.                     char huge *scrbfr ;
  1264.                     scr_vsave (&ti,&scrbfr) ;
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.           The LIBerator 1.0        User's Guide                     Page 23
  1280.  
  1281.  
  1282.  
  1283.  
  1284.           SCR_VRESTORE
  1285.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1286.  
  1287.           ■ Summary This  function  will restore  the current  screen video
  1288.                     mode  and  the  text  window  size  from  a 'text_info'
  1289.                     structure.   It can also  restore the screen content if
  1290.                     it was saved by a previous call to {scr_vsave}.
  1291.  
  1292.           ■ Syntax  #include "scrfcts.h"
  1293.                     void  scr_vrestore  (struct  text_info  huge  *ti, char
  1294.                     huge*huge *savedscr) ;
  1295.  
  1296.           ■ Remarks The  'text_info'  structure must  have  been previously
  1297.                     filled  with  {scr_vsave}.   The same  is true  for the
  1298.                     previous screen content.
  1299.  
  1300.                -->  If  the screen  area was  not saved,  set <savedscr> to
  1301.                     NULL.
  1302.  
  1303.                     The memory will be liberated when the screen content is
  1304.                     restored.  So you can't restore it more than once.
  1305.  
  1306.           ■ Return  None
  1307.  
  1308.           ■ Example scr_vrestore (&ti,&scrbfr) ;
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.           The LIBerator 1.0        User's Guide                     Page 24
  1338.  
  1339.  
  1340.  
  1341.  
  1342.           SCR_CSAVE
  1343.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1344.  
  1345.           ■ Summary This   function  will   save  all   cursor  attributes,
  1346.                     INCLUDING  THE CURSOR TYPE,  in a {cur_info} structure.
  1347.                     Those  attributes  are:    colors,  x  pos,  y  pos and
  1348.                     cursorshape.
  1349.  
  1350.           ■ Syntax  #include "scrfcts.h"
  1351.                     void scr_csave (struct cur_info huge *ci) ;
  1352.  
  1353.           ■ Remarks The  {cur_info} structure is as  follow, and is defined
  1354.                     in "scrfcts.h".
  1355.  
  1356.                     struct cur_info
  1357.                     {
  1358.                        unsigned char attribute ;        /* Cursor colors */
  1359.                        unsigned char curx ;         /* Cursor X position */
  1360.                        unsigned char cury ;         /* Cursor Y position */
  1361.                        unsigned int  curtype ;            /* Cursor type */
  1362.                     } ;
  1363.  
  1364.           ■ Return  None
  1365.  
  1366.           ■ Example struct cur_info ci ;
  1367.                     scr_csave (&ci) ;
  1368.  
  1369.  
  1370.           SCR_CRESTORE
  1371.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1372.  
  1373.           ■ Summary This  function  will  restore  all  cursor  attributes,
  1374.                     INCLUDING THE CURSOR TYPE, from a {cur_info} structure.
  1375.  
  1376.           ■ Syntax  #include "scrfcts.h"
  1377.                     void scr_crestore (struct cur_info huge *ci) ;
  1378.  
  1379.           ■ Remarks The  cursor attributes must  have been previously saved
  1380.                     with {scr_csave}.   
  1381.  
  1382.           ■ Return  None
  1383.  
  1384.           ■ Example struct cur_info ci ;
  1385.                     scr_csave (&ci) ;
  1386.                     ...
  1387.                     scr_crestore (&ci) ;
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.           The LIBerator 1.0        User's Guide                     Page 25
  1396.  
  1397.  
  1398.  
  1399.  
  1400.           █████████████████████████████████████████████████████████████████
  1401.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1402.           C  H  A  P  T  E  R     9            LIBerator's string functions
  1403.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1404.  
  1405.           The  declarations for LIBerator's  string functions are contained
  1406.           in the <STRFCTS.H> header file.
  1407.  
  1408.  
  1409.           STR_LEN
  1410.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1411.  
  1412.           ■ Summary This  is a  huge version of  'strlen'.   It returns the
  1413.                     length of a string.
  1414.  
  1415.           ■ Syntax  #include "strfcts.h"
  1416.                     size_t str_len (char huge *string) ;
  1417.  
  1418.           ■ Remarks The only difference with 'strlen' is that this function
  1419.                     offers  the convenience of accepting  a huge pointer as
  1420.                     argument.
  1421.  
  1422.           ■ Return  The length of the string.  The type 'size_t' is defined
  1423.                     in <stdio.h> as an unsigned int.
  1424.  
  1425.           ■ Example length = str_len (text) ;
  1426.  
  1427.  
  1428.           STR_CPY
  1429.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1430.  
  1431.           ■ Summary This is a huge version of 'strcpy'.  It copies a string
  1432.                     into another, including the terminating '\0' character.
  1433.  
  1434.           ■ Syntax  #include "strfcts.h"
  1435.                     char huge *str_cpy (char huge *dest, char huge *src) ;
  1436.  
  1437.           ■ Remarks The only difference from 'strcpy' is that this function
  1438.                     offers  the convenience  of accepting  huge pointers as
  1439.                     arguments.
  1440.  
  1441.           ■ Return  A huge pointer to the destination string.
  1442.  
  1443.           ■ Example char huge *string ;
  1444.                     string = heapalloc (20) ;
  1445.                     str_cpy (string,"Hello there !") ;
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.           The LIBerator 1.0        User's Guide                     Page 26
  1454.  
  1455.  
  1456.  
  1457.  
  1458.           STR_CMP
  1459.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1460.  
  1461.           ■ Summary This  is a huge  version of 'strcmp'.   It compares one
  1462.                     string to another.
  1463.  
  1464.           ■ Syntax  #include "strfcts.h"
  1465.                     int str_cmp (char huge *string1, char huge *string2) ;
  1466.  
  1467.           ■ Remarks The only difference from 'strcmp' is that this function
  1468.                     offers  the convenience  of accepting  huge pointers as
  1469.                     arguments.
  1470.  
  1471.           ■ Return  {str_cmp} returns a value that is :
  1472.  
  1473.                     <0 if <string1> is less than <string2>
  1474.                     =0 if <string1> is the same as <string2>
  1475.                     >0 if <string1> is greater than <string2>
  1476.  
  1477.           ■ Example if (str_cmp (name[i],name[i+1]) > 0)
  1478.                     {
  1479.                        /* Invert string (bubble sort) */
  1480.                     }
  1481.  
  1482.  
  1483.           STR_ICMP
  1484.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1485.  
  1486.           ■ Summary This  is a huge version of  'stricmp'.  It compares one
  1487.                     string to another, without case sensitivity.
  1488.  
  1489.           ■ Syntax  #include "strfcts.h"
  1490.                     int str_icmp (char huge *string1, char huge *string2) ;
  1491.  
  1492.           ■ Remarks The   only  difference  from  'stricmp'  is  that  this
  1493.                     function  offers  the  convenience  of  accepting  huge
  1494.                     pointers as arguments.
  1495.  
  1496.           ■ Return  {str_icmp} returns a value that is :
  1497.  
  1498.                     <0 if <string1> is less than <string2>
  1499.                     =0 if <string1> is the same as <string2>
  1500.                     >0 if <string1> is greater than <string2>
  1501.  
  1502.           ■ Example if (str_icmp (name[i],name[i+1]) > 0)
  1503.                     {
  1504.                        /* Invert string (bubble sort) */
  1505.                     }
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.           The LIBerator 1.0        User's Guide                     Page 27
  1512.  
  1513.  
  1514.  
  1515.  
  1516.           STR_TOUPPER
  1517.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1518.  
  1519.           ■ Summary This function translates a string to uppercase.
  1520.  
  1521.           ■ Syntax  #include "strfcts.h"
  1522.                     void str_toupper (char huge *string) ;
  1523.  
  1524.           ■ Remarks None.
  1525.  
  1526.           ■ Return  None.
  1527.  
  1528.           ■ Example str_toupper (name) ;
  1529.  
  1530.  
  1531.           STR_TOLOWER
  1532.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1533.  
  1534.           ■ Summary This function translates a string to lowercase.
  1535.  
  1536.           ■ Syntax  #include "strfcts.h"
  1537.                     void str_tolower (char huge *string) ;
  1538.  
  1539.           ■ Remarks None.
  1540.  
  1541.           ■ Return  None.
  1542.  
  1543.           ■ Example str_tolower (name) ;
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.           The LIBerator 1.0        User's Guide                     Page 28
  1570.  
  1571.  
  1572.  
  1573.  
  1574.           STR_PASTOC
  1575.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1576.  
  1577.           ■ Summary This  function  translates a  string  from PASCAL  to C
  1578.                     internal format.
  1579.  
  1580.           ■ Syntax  #include "strfcts.h"
  1581.                     void str_pastoc (char huge *string) ;
  1582.  
  1583.           ■ Remarks All  characters in  the string  will be  shifted left 1
  1584.                     space  and a  '\0' will be  appended at the  end of the
  1585.                     string.
  1586.  
  1587.                     This  is useful  is you're  reading records  written in
  1588.                     pascal format.
  1589.  
  1590.           ■ Return  None.
  1591.  
  1592.           ■ Example str_pastoc (name) ;
  1593.  
  1594.  
  1595.           STR_CTOPAS
  1596.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1597.  
  1598.           ■ Summary This  function  translates a  string  from C  to PASCAL
  1599.                     internal format.
  1600.  
  1601.           ■ Syntax  #include "strfcts.h"
  1602.                     void str_ctopas (char huge *string) ;
  1603.  
  1604.           ■ Remarks All  characters in the  string will be  shifted right 1
  1605.                     space, overwriting the terminating '\0'.  The length of
  1606.                     the  string will then  be put in the  first byte of the
  1607.                     array.
  1608.  
  1609.                -->  The string MUST be 255 or less characters long.
  1610.  
  1611.                     This  is useful  is you're  reading records  written in
  1612.                     pascal  format, converted them  to C with {str_pastoc},
  1613.                     then reconverting to pascal before writting to disk.
  1614.  
  1615.           ■ Return  None.
  1616.  
  1617.           ■ Example str_ctopas (name) ;
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.           The LIBerator 1.0        User's Guide                     Page 29
  1628.  
  1629.  
  1630.  
  1631.  
  1632.           STR_TRIM
  1633.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1634.  
  1635.           ■ Summary This  function removes leading and trailing spaces from
  1636.                     a string.
  1637.  
  1638.           ■ Syntax  #include "strfcts.h"
  1639.                     void str_trim (char huge *string) ;
  1640.  
  1641.           ■ Remarks Useful to normalise an input.
  1642.  
  1643.           ■ Return  None.
  1644.  
  1645.           ■ Example str_trim (name) ;
  1646.  
  1647.  
  1648.           STR_INVNAMES
  1649.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1650.  
  1651.           ■ Summary This  function inverts first  and last names  in a name
  1652.                     string.
  1653.  
  1654.           ■ Syntax  #include "strfcts.h"
  1655.                     void str_invnames (char huge *string) ;
  1656.  
  1657.           ■ Remarks A  name string  is composed  of 1  or more  clusters of
  1658.                     characters.   Clusters are  packets separated from each
  1659.                     other by 1 or more spaces.
  1660.  
  1661.                     {str_invnames}  will take the first cluster and move it
  1662.                     to the end of the string.
  1663.  
  1664.                     Examples:
  1665.  
  1666.                     "Remy"                becomes "Remy"
  1667.                     "Remy Gendron"        becomes "Gendron Remy"
  1668.                     "Remy J. Gendron"     becomes "J. Gendron Remy"
  1669.                     "This is some string" becomes "is some string This"
  1670.  
  1671.                     This  could be  useful if you're  doing a  sort by last
  1672.                     names then first names, but your name string are in the
  1673.                     form first then last.
  1674.  
  1675.           ■ Return  None.
  1676.  
  1677.           ■ Example str_invnames (name) ;
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.           The LIBerator 1.0        User's Guide                     Page 30
  1686.  
  1687.  
  1688.  
  1689.  
  1690.           █████████████████████████████████████████████████████████████████
  1691.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1692.           C  H  A  P  T  E  R     10             LIBerator's time functions
  1693.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1694.  
  1695.           The  declarations for LIBerator's time functions are contained in
  1696.           the <TIMEFCTS.H> header file.
  1697.  
  1698.  
  1699.           TICKTIMER_INSTALL
  1700.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1701.  
  1702.           ■ Summary This function installs or removes a tick counter.
  1703.  
  1704.           ■ Syntax  #include "timefcts.h"
  1705.                     void ticktimer_install (void) ;
  1706.  
  1707.           ■ Remarks Ticks  are  PC's clock  units.   They are  1/18 seconds
  1708.                     long.   The ticktimer routines  will allow you to count
  1709.                     those ticks.
  1710.  
  1711.                     The  first call to  {ticktimer_install} will install an
  1712.                     interrupt,  whose purpose is to  count ticks.  A second
  1713.                     call   to  the  {ticktimer_install}   will  remove  the
  1714.                     interrupt.
  1715.  
  1716.           ■ Return  None.
  1717.  
  1718.           ■ Example ticktimer_install () ;
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.           The LIBerator 1.0        User's Guide                     Page 31
  1744.  
  1745.  
  1746.  
  1747.  
  1748.           TICKTIMER_RESET
  1749.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1750.  
  1751.           ■ Summary This function resets the tick count to zero.
  1752.  
  1753.           ■ Syntax  #include "timefcts.h"
  1754.                     void ticktimer_reset (void) ;
  1755.  
  1756.           ■ Remarks After  installation of the interrupt, the tick count is
  1757.                     undefined.   You must reset  the count before using the
  1758.                     {ticktimer_read}  function.   Also,  you can  reset the
  1759.                     count to zero anytime you like.
  1760.  
  1761.                -->  Using this function will introduce a random delay of up
  1762.                     to  1/18  second.   The function  will wait  before the
  1763.                     beginning  of  the next  tick  before returning.   This
  1764.                     garanties that tick #1 will really be 1 tick long.
  1765.  
  1766.           ■ Return  None.
  1767.  
  1768.           ■ Example ticktimer_reset () ;
  1769.  
  1770.  
  1771.           TICKTIMER_READ
  1772.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1773.  
  1774.           ■ Summary This function returns the current tick count.
  1775.  
  1776.           ■ Syntax  #include "timefcts.h"
  1777.                     dword ticktimer_read (void) ;
  1778.  
  1779.           ■ Remarks After  installation of the interrupt, the tick count is
  1780.                     undefined.   You must reset  the count before using the
  1781.                     {ticktimer_read}  function.   Using this  function does
  1782.                     not resets the counter.
  1783.  
  1784.           ■ Return  The    number    of   ticks    since   last    use   of
  1785.                     {ticktimer_reset}.  {ticktimer_read} returns a {dword}.
  1786.                     {dword}  is defined  in STDTYPE.H  as an  unsigned long
  1787.                     int.
  1788.  
  1789.           ■ Example dword count ;
  1790.  
  1791.                     ticktimer_install () ;              /* Install timer */
  1792.                     ticktimer_reset () ;             /* Reset timer to 0 */
  1793.                     function (argument) ;          /* Call your function */
  1794.                     count = ticktimer_read () ;       /* Get ticks count */
  1795.                     ticktimer_install () ;           /* De-install timer */
  1796.  
  1797.  
  1798.  
  1799.  
  1800.  
  1801.           The LIBerator 1.0        User's Guide                     Page 32
  1802.  
  1803.  
  1804.  
  1805.  
  1806.           DIFFDATE
  1807.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1808.  
  1809.           ■ Summary Calculates absolute number of days between two dates.
  1810.  
  1811.           ■ Syntax  #include "timefcts.h"
  1812.                     dword  diffdate (int  day1, int month1,  int year1, int
  1813.                     day2, int month2, int year2) ;
  1814.  
  1815.           ■ Remarks day1/day2     : Days of date 1 and 2. (1-31)
  1816.                     month1/month2 : Months of date 1 and 2. (1-12)
  1817.                     year1/year2   : Years of date 1 and 2. (1583 and after)
  1818.  
  1819.           ■ Return  The  absolute  number  of  days  between  the  2 dates.
  1820.                     {diffdate}  returns a  {dword}.  {dword}  is defined in
  1821.                     STDTYPE.H as an unsigned long int.
  1822.  
  1823.           ■ Example dword count ;
  1824.                     count   =   diffdate  (userday,   usermonth,  useryear,
  1825.                     todayday, todaymonth, todayyear) ;
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.           The LIBerator 1.0        User's Guide                     Page 33
  1860.  
  1861.  
  1862.  
  1863.  
  1864.           █████████████████████████████████████████████████████████████████
  1865.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1866.           C  H  A  P  T  E  R     11             LIBerator's misc functions
  1867.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1868.  
  1869.           The  declarations  for  LIBerator's  miscellaneous  functions are
  1870.           contained in the <MISCFCTS.H> header file.
  1871.  
  1872.  
  1873.           ANSICOLOR
  1874.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1875.  
  1876.           ■ Summary Converts  normal background and  foreground color codes
  1877.                     to color codes for ANSI escape sequence.
  1878.  
  1879.           ■ Syntax  #include "miscfcts.h"
  1880.                     void  ansicolor (int fore, int back, int huge *ansbold,
  1881.                     int huge *ansfore, int huge *ansback) ;
  1882.  
  1883.           ■ Remarks fore, back : Standard screen colors.
  1884.                     *ansbold   : Ptr to int to return bold value.
  1885.                     *ansfore   : Ptr to int to return fore value.
  1886.                     *ansback   : Ptr to int to return back value.
  1887.  
  1888.                     To interpret ANSI escape sequences, the ANSI.SYS driver
  1889.                     must be loaded.
  1890.  
  1891.           ■ Return  None.
  1892.  
  1893.           ■ Example int bold, fore, back ;
  1894.                     ansicolor (LIGHTGREEN,BLACK,&bold,&fore,&back) ;
  1895.                     printf ("\x1b[%d;%d;%dm",bold,fore,back) ;
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.           The LIBerator 1.0        User's Guide                     Page 34
  1918.  
  1919.  
  1920.  
  1921.  
  1922.           █████████████████████████████████████████████████████████████████
  1923.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1924.           A  P  P  E  N  D  I  X     A                    Extended keycodes
  1925.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1926.  
  1927.           Extended  keycodes are returned when you press a key that doesn't
  1928.           have  an associated ASCII code.  They are represented by stuffing
  1929.           2  codes into the keyboard  buffer.  A 0  followed by an extended
  1930.           key keycode in the range 0 through 255.
  1931.  
  1932.           The  EasyVision  {getkey}  function  deals  with  these  codes by
  1933.           returning  values (int) in the range 0 through 511.  The standard
  1934.           ASCII  codes  are returned  unchanged  (Guess why  ?).   Extended
  1935.           keycodes  are added 256 to their  real value for convenience, and
  1936.           are returned as a single number.  Here they are...
  1937.  
  1938.           259       NUL
  1939.           271       Shift-TAB
  1940.           272-281   Alt Q/W/E/R/T/Y/U/I/O/P
  1941.           286-294   Alt A/S/D/F/G/H/J/K/L
  1942.           300-306   Alt Z/X/C/V/B/N/M
  1943.           315-324   F1 to F10
  1944.           327       Home
  1945.           328       Up arrow key
  1946.           329       Page Up
  1947.           331       Left arrow key
  1948.           333       Right arrow key
  1949.           335       End
  1950.           336       Down arrow key
  1951.           337       Page Down
  1952.           338-339   Ins/Del
  1953.           340-349   Shift-F1 to Shift-F10
  1954.           350-359   Ctrl-F1 to Ctrl-F10
  1955.           360-369   Alt-F1 to Alt-F10
  1956.           370       Ctrl-Print Screen
  1957.           371       Ctrl-Left arrow key
  1958.           372       Ctrl-Right arrow key
  1959.           373       Ctrl-End
  1960.           374       Ctrl-Page Down
  1961.           375       Ctrl-Home
  1962.           376-387   Alt 1/2/3/4/5/6/7/8/9/0/-/=
  1963.           388       Ctrl-Page Up
  1964.           389-390   F11/F12
  1965.           391       Shift-F11
  1966.           392       Shift-F12
  1967.           393       Ctrl-F11
  1968.           394       Ctrl-F12
  1969.           395-396   Alt-F11/Alt-F12
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.           The LIBerator 1.0        User's Guide                     Page 35
  1976.  
  1977.  
  1978.  
  1979.  
  1980.           █████████████████████████████████████████████████████████████████
  1981.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  1982.           A  P  P  E  N  D  I  X     B   Color Codes and Symbolic constants
  1983.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  1984.  
  1985.           When  asked for  a color  argument, you  must provide  one of the
  1986.           following  values.  As  an alternative, you  can also use special
  1987.           MACROS, provided <conio.h> as been included.
  1988.  
  1989.  
  1990.  
  1991.           Available background colors:
  1992.  
  1993.                     0  BLACK
  1994.                     1  BLUE
  1995.                     2  GREEN
  1996.                     3  CYAN
  1997.                     4  RED
  1998.                     5  MAGENTA
  1999.                     6  BROWN
  2000.                     7  LIGHTGRAY
  2001.  
  2002.  
  2003.  
  2004.           Available foreground colors:
  2005.  
  2006.                     0  BLACK       8  DARKGRAY
  2007.                     1  BLUE        9  LIGHTBLUE
  2008.                     2  GREEN       10 LIGHTGREEN
  2009.                     3  CYAN        11 LIGHTCYAN
  2010.                     4  RED         12 LIGHTRED
  2011.                     5  MAGENTA     13 LIGHTMAGENTA
  2012.                     6  BROWN       14 YELLOW
  2013.                     7  LIGHTGRAY   15 WHITE
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.           The LIBerator 1.0        User's Guide                     Page 36
  2034.  
  2035.  
  2036.  
  2037.  
  2038.           █████████████████████████████████████████████████████████████████
  2039.           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  2040.           A  P  P  E  N  D  I  X     C                              Support
  2041.           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  2042.  
  2043.           I  will gladly answer any questions relating to this software.  I
  2044.           can  be reach directly by netmail.  Address your message to 'Remy
  2045.           Gendron' or 'sysop'.
  2046.  
  2047.           All   those   functions  have   already   been  tested   in  real
  2048.           applications.
  2049.  
  2050.           Any comments, bug reports or suggestions will be appreciated.
  2051.  
  2052.  
  2053.  
  2054.                                 STARFLEET COMMAND BBS
  2055.                               (418)  525-6899/4740/6803
  2056.                                  FidoNet: 1:240/1701
  2057.  
  2058.                                          or
  2059.  
  2060.                                 TNG SOFT ENTERPRISES
  2061.                                   2480 Ave de Vitre
  2062.                                    Quebec, Quebec
  2063.                                        Canada
  2064.                                        G1J 4A6
  2065.  
  2066.  
  2067.  
  2068.           Thank you for using this software !
  2069.  
  2070.           Remy Gendron
  2071.           Author of EasyVision
  2072.  
  2073.